﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CKS2320.Common.Model
{
    public class DataQueryListModel
    {
        /// <summary>
        /// AorB
        /// </summary>
        public string RunType { get; set; }
        /// <summary>
        /// 产品ID
        /// </summary>
        public string PartCode { get; set; }
        /// <summary>
        /// 全长
        /// </summary>
        public string PartLength { get; set; }
        /// <summary>
        /// 产品数据
        /// </summary>
        public string DetectedType { get; set; }
        /// <summary>
        /// 指标
        /// </summary>
        public bool? Indicator { get; set; }
        /// <summary>
        /// 公差带
        /// </summary>
        public bool? ToleranceZone { get; set; }
        /// <summary>
        /// 测量值
        /// </summary>
        public float? DetectedData { get; set; }
        /// <summary>
        /// 测量用时
        /// </summary>
        public string DetectedTime { get; set; }
        /// <summary>
        /// 测量状态
        /// </summary>
        public bool? DetectedResult { get; set; }
        /// <summary>
        /// 图片显示
        /// </summary>
        public string DetectedImage { get; set; }
    }

    public class DataQueryResponse
    {
        public int? totalOK { get; set; } = 0;
        public int? totalNG { get; set; } = 0;
        public List<DataQueryListModel> list { get; set; } = new();
    }
    public class DataQueryResponseNew
    {
        //已检测
        public int? Detected { get; set; } = 0;
        //OK
        public int? OK { get; set; } = 0;
        //NG
        public int? NG { get; set; } = 0;
        public int? ThicknessNG { get; set; } = 0;
        public int? BOWNG { get; set; } = 0;
        public int? camberNG { get; set; } = 0;
        public float? totalRunTime {  get; set; }=0;
        public float? faultTime { get; set; } = 0;
        public float? stopTime { get; set; } = 0;
        public float? holdTime { get; set; } = 0;
        public float? OEE { get; set; } = 0;

        //public int? totalNG { get; set; } = 0;
        //public List<DataQueryListModel> list { get; set; } = new();
        //A数组
        public List<DataQuery> listA { get; set; } = new();
        //B数组
        public List<DataQuery> listB { get; set; } = new();

    }
    public class ExportQueryModel
    {
        //已检测
        public int? No  { get; set; } = 0;
        //OK
        public string? Bow  { get; set; }
        //NG
        public string? BowResult { get; set; }
        public string? PartCode { get; set; }
        /// <summary>
        /// DC 最终电流
        /// </summary>
        public string? Pot { get; set; }
        /// <summary>
        /// DC 设定电压
        /// </summary>
        public string? voltageDC { get; set; }
        /// <summary>
        /// DC 结果
        /// </summary>
        public string? PotResult { get; set; }

        /// <summary>
        /// AC 最终电流
        /// </summary>
        public string? PotAC { get; set; }
        /// <summary>
        /// AC 设定电压
        /// </summary>
        public string? voltageAC { get; set; }
        /// <summary>
        /// AC 结果
        /// </summary>
        public string? PotResultAC { get; set; }
        public string? Camber{ get; set; }

        public string? ResultCamber { get; set; }
        public string? TotalLength { get; set; }
        public string? TotalLengthResult { get; set; }

        /// 背面波间距2
        /// </summary>
        public string? BackScallop2Pitch { get; set; }
        /// <summary>
        /// 背面波直径2
        /// </summary>
        public string? BackScallop2Diameter { get; set; }
        /// <summary>
        /// 背面波间距3
        /// </summary>
        public string? BackScallop3Pitch { get; set; }
        /// <summary>
        /// 背面波直径3
        /// </summary>
        public string? BackScallop3Diameter { get; set; }

        /// 正面波间距2
        /// </summary>
        public string? FrontScallop2Pitch { get; set; }
        /// <summary>
        /// 正面波直径2
        /// </summary>
        public string? FrontScallop2Diameter { get; set; }
        /// <summary>
        /// 正面波间距3
        /// </summary>
        public string? FrontScallop3Pitch { get; set; }
        /// <summary>
        /// 正面波直径3
        /// </summary>
        public string? FrontScallop3Diameter { get; set; }
        /// <summary>
        /// 正面厚度7  正面最大值
        /// </summary>
        public string? FrontThickness7 { get; set; }
        /// <summary>
        /// 背面厚度7 正面最小值
        /// </summary>
        public string? BackThickness7 { get; set; }

        /// <summary>
        /// 正面barb到1
        /// </summary>
        public string? FrontBarbLst1 { get; set; }
        /// <summary>
        /// 正面barb到1结果
        /// </summary>
        public string? FrontBarbLst1Result { get; set; }
        /// <summary>
        /// 正面barb到最后
        /// </summary>
        public string? FrontBarbLast { get; set; }
        /// <summary>
        /// 正面barb到最后结果
        /// </summary>
        public string? FrontBarbLastResult { get; set; }
        /// <summary>
        /// 背面barb到1  20241204修改为背面膜厚最大值
        /// </summary>
        public string? BackBarbLst1 { get; set; }
        /// <summary>
        /// 背面barb到最后  20241204修改为背面膜厚最大值
        /// </summary>
        public string? BackBarbLast { get; set; }
        public string? OP10Passageway {  get; set; }
        public string? OP20Passageway { get; set; }
        public string? OP30Passageway { get; set; }



        public string?OP10Time { get; set; }
        public string? OP20Time { get; set; }
        public string? OP30Time { get; set; }
        public string? OP20Finaljuge { get; set; }
        public string? OP30Finaljuge { get; set; }


    }
    public class ExportQueryCount
    {
        public int? No { get; set; }
        //已检测
        public string? DatatimeName { get; set; }
        //OK
        public int? BowCount { get; set; }
        //NG
        public int? BowOK { get; set; }
        public int? BowNG { get; set; }
        public int? hipotCount { get; set; }
        public int? hipotOK { get; set; }
        public int? hipotNG { get; set; }
        public int? CamberCount { get; set; }
        public int? CamberOK { get; set; }
        public int? CamberNG { get; set; }
     

    }
    public class DataQuery
    {
        //public int? totalOK { get; set; } = 0;
        //public int? totalNG { get; set; } = 0;
        //public List<DataQueryListModel> list { get; set; } = new();
        public string? RunType { get; set; }
        
        //产品二维码
        public string? PartCode { get; set; }
        //1号检测台ID
        public string? ShapeID { get; set; }
        //BOW
        public string? BOW { get; set; }
        //Hi-pot
        public string? POT { get; set; }
        //2号检测台ID
        public string? VoltagewithstandID { get; set; }
        //3号检测台ID
        public string? ThicknessdetectionID { get; set; }
        //Camber
        public string? Camber { get; set; }
        //总长
        public string? TotalLength { get; set; }
        //Barb到1st波
        public string? Barb1 { get; set; }
        //Barb到last波
        public string? Barb2 { get; set; }

        public string? BackBarb1 { get; set; }
        //Barb到last波
        public string? BackBarb2 { get; set; }
        public string? fctmax { get; set; }
        //Barb到last波
        public string? fctmin { get; set; }
        public string? bctmax { get; set; }
        //Barb到last波
        public string? bctmin { get; set; }
        //膜厚
        public string? Thickness { get; set; }
        //结果
        public string? Result { get; set; }

    }

    public class ThicknessResponse
    {
        //正面
        public string? DetectedTypeFront { get; set; }
        public string? FrontData { get; set; }
        //背面
        public string? DetectedTypeBack { get; set; }
        public string? BackData { get; set; }
    }

    public class HistoryDataTrendsPackResponse
    {
        public List<HistoryDataTrendsPack> bow { get; set; } = new();
        public List<HistoryDataTrendsPack> camble { get; set; } = new();
        public List<HistoryDataTrendsPack> entireLength { get; set; } = new();
    }

    public class HistoryDataTrendsPack
    {
        /// <summary>
        /// 小时
        /// </summary>
        public string hour { get; set; } = string.Empty;
        /// <summary>
        /// 指标
        /// </summary>
        public string indicator { get; set; } = string.Empty;
        /// <summary>
        /// 数据
        /// </summary>
        public List<float?> data { get; set; } = new();

    }


    public class ExportQueryListModel
    {
        /// <summary>
        /// 产品ID
        /// </summary>
        public string PartCode { get; set; } = string.Empty;
        /// <summary>
        /// IP
        /// </summary>
        public string PLCIP { get; set; } = string.Empty;
        /// <summary>
        /// 检测台
        /// </summary>
        public string StationCode { get; set; } = string.Empty;
        /// <summary>
        /// 检测数据
        /// </summary>
        public float? DetectedData { get; set; }
        /// <summary>
        /// 检测类型
        /// </summary>
        public string DetectedType { get; set; } = string.Empty;
        /// <summary>
        /// A/B件
        /// </summary>
        public string Description { get; set; } = string.Empty;
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedTime { get; set; }
    }
}
